package com.eds.feign;


import com.pojo.TeacherSchedule;
import com.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName：UserService
 * @Author: vvSmile
 * @Date: 2025/03/19
 * @Description: 必须描述类做什么事情, 实现什么功能
 */
@FeignClient("eds-frontend-user")
public interface UserService {
    //根据Token获取用户ID
    @PostMapping("/userController/getUserIdFromToken")
    Long getUserIdFromToken(@RequestParam("token") @RequestHeader("authorization") String token);

    //根据Token获取用户信息
    @GetMapping("/userController/getUserInfo")
    User getUserInfo(@RequestHeader("authorization") String token);

    //通过课程信息查询用户信息
    @GetMapping("/userController/getUserInfoByTeacherId")
    User getUserInfoByTeacherId(@RequestParam("userId") Long userId);


    //处理课程安排数据
    @PostMapping("/teacherController/insertSchedule")
    boolean insertSchedule(@RequestBody TeacherSchedule schedule);


    //查询课程时间
    @GetMapping("/teacherController/selectTeacherSchedules")
    List<TeacherSchedule> selectTeacherSchedules(@RequestParam("courseId") Long courseId);


    //更新课程时间状态为-1
    @GetMapping("/teacherController/updateScheduleStatusDel")
    Boolean updateScheduleStatusDel(@RequestParam("courseId") Long courseId);


    //更新课程时间信息
    @PostMapping("/teacherController/updateScheduleInfo")
    boolean updateScheduleInfo(@RequestBody TeacherSchedule teacherSchedule);



    //删除所有的Schedule
    @DeleteMapping("/teacherController/deleteAllSchedule")
    int deleteAllSchedule(@RequestParam("courseId") Long courseId);

    //查询课程安排信息
    @GetMapping("/teacherController/selectTeacherSchedulesByScheduleId")
    TeacherSchedule selectTeacherSchedulesByScheduleId(@RequestParam("scheduleId") Long scheduleId);

    //更新课程安排状态为-1
    @PostMapping("/teacherController/updateScheduleStatusReverseBooking")
    Boolean updateScheduleStatusReverseBooking(@RequestBody TeacherSchedule teacherSchedule);

    //查询课程Id
    @GetMapping("/teacherController/selectCourseIdByScheduleId")
    TeacherSchedule selectCourseIdByScheduleId(@RequestParam("scheduleId") Long scheduleId);

    //删除课程安排
    @DeleteMapping("/teacherController/delSchedule")
    Boolean delSchedule(@RequestBody TeacherSchedule teacherSchedule);

    //查询课程安排
    @PostMapping("/teacherController/selectTeacherSchedulesBySchedule")
    TeacherSchedule selectTeacherSchedulesBySchedule(@RequestBody TeacherSchedule teacherSchedule);


    //查询课程安排
    @PostMapping("/teacherController/selectTeacherSchedulesByScheduleAndUserId")
    TeacherSchedule selectTeacherSchedulesByScheduleAndUserId(@RequestBody TeacherSchedule teacherSchedule);

    //查询课程安排
    @GetMapping("/teacherController/selectTeacherSchedulesByUserId")
    List<TeacherSchedule> selectTeacherSchedulesByUserId(@RequestParam("scheduleId") Long userId);

    //通过用户Id查询用户信息
    @GetMapping("/userController/getUserByUserId")
    public User getUserByUserId(@RequestParam("userId") Long userId);
}
